package edu.xmut.kakamusic.viewmodel;

import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

import java.util.ArrayList;
import java.util.List;

import edu.xmut.kakamusic.R;
import edu.xmut.kakamusic.bean.entity.BoomMenuItem;

public class ChartViewModel extends ViewModel {
    private MutableLiveData<List<BoomMenuItem>> liveData;

    public ChartViewModel() {
        liveData = new MutableLiveData<>();
        ArrayList<BoomMenuItem> list = new ArrayList<>();
        String[] texts = {"Java", "PHP", "Android", "黑马程序员.Python", "黑马程序员.C/C++",
                "黑马程序员.IOS", "黑马程序员.前端与移动开发", "黑马程序员.UI设计", "黑马程序员.网络营销"};
        int[] imageId = {R.drawable.bat, R.drawable.bear, R.drawable.bee, R.drawable.butterfly,
                R.drawable.cat, R.drawable.dolphin, R.drawable.eagle, R.drawable.horse, R.drawable.elephant};
        for (int i = 0; i < texts.length; i++) {
            list.add(new BoomMenuItem(texts[i], imageId[i]));
        }
        liveData.setValue(list);
    }

    public MutableLiveData<List<BoomMenuItem>> getList() {
        return liveData;
    }
}
